#include "cuError.h"

bool cuCheckError(int line, const char *file)
{
	cudaError_t error = cudaGetLastError();
	
	if (error != cudaSuccess)
		fprintf(stderr, "CUDA error at line %d in file %s: %s", line, file, cudaGetErrorString(error));

	// return true if error actually happened
	return error != cudaSuccess;
}